var barcode = null;

function barcodeStart(onmarked){
	barcode = new plus.barcode.Barcode('scan', [plus.barcode.QR], {
		frameColor: '#009DE2',
		scanbarColor: '#009DE2',
	});
	barcode.onmarked = onmarked;
	barcode.onerror = function(error){
		// loaded code 
		console.log('扫码结果：' + error);
		barcodeClose()
	}
	barcode.start();
}
function barcodeClose(){
	barcode.close();
}